export default {
  currentsong (state) {
    return state.playlist[state.currentindex] || {}
  },
  // 判断当前歌曲是否收藏
  iscollect (state, getters) {
    const iscollect =
      state.collectlist.findIndex((item, i) => {
        return getters.currentsong.id === item.id
      }) !== -1
    return iscollect
  },
  // 当前歌曲在squencelist的下标
  squenceindex (state, getters) {
    return state.squencelist.findIndex(
      (item) => item.id === getters.currentsong.id
    )
  }
}
